#!/usr/bin/perl
sub get_op_line_opchain{                                             #This is the subroutine for getting the proper line of output from the whole output
	my(@full_output) = @_;                                       #for rules involving the output chain
	$flag = 0;
	foreach $local_variable (@full_output){
		if ($local_variable =~/permitted/){
			$reqd_line_op = $local_variable;                                #arr1 has the output line which contains operation not permitted.
			$flag = 1;
		}
		if ($flag == 1){
			break;
		}
	}
	foreach $local_variable (@full_output){
		if ($local_variable =~/command/){
			$reqd_line_op = $local_variable;
			$flag = 2;
		}
		if ($flag == 2){
			break;
		}
	}
	@split_reqd_line = split(' ',$reqd_line_op);
	return($reqd_line_op,$flag,@split_reqd_line);                                              #$arr1 maps to $opfullarr ------ @zzz maps to @spl1.
}
1;
